scrolledwindow: reset more Indicator state on ::unmap
authorCarlos Garnacho <carlosg@gnome.org>
Fri, 22 May 2015 18:52:17 +0000 (20:52 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Fri, 22 May 2015 19:16:36 +0000 (21:16 +0200)
If a GtkScrolledWindow is just unmapped and promptly mapped again, the
indicators are left in a semi-visible state, so the GdkWindow isn't raised
properly above scrolledwindow content. This inconsistent state went away
the next time the indicator is hidden.

So, reset all state about indicator window visibility, animation
progress and conceil timer on ::unmap, this will be enough to make the
indicators start out hidden like on newly created scrolledwindows.

gtk/gtkscrolledwindow.c

index 9d073feee18ecb0392b475866b84567d9e241445..24e9a6ff27242bce570c1076f677da7f88c2f51e 100644 (file)
@@ -3932,6 +3932,16 @@ indicator_stop_fade (Indicator *indicator)
       gtk_widget_remove_tick_callback (indicator->scrollbar, indicator->tick_id);
       indicator->tick_id = 0;
     }
+
+  if (indicator->conceil_timer)
+    {
+      g_source_remove (indicator->conceil_timer);
+      indicator->conceil_timer = 0;
+    }
+
+  gdk_window_hide (indicator->window);
+  indicator->current_pos = indicator->source_pos = indicator->target_pos = 0;
+  indicator->start_time = indicator->end_time = indicator->last_scroll_time = 0;
 }
 
 static gboolean